# coding = utf-8
from django.urls import path
from rest_framework.routers import DefaultRouter

from .views import CompanyContractViewSet, PrivateContractViewSet, PersonInfoViewSet, CompanyInfoViewSet, \
    ContractAmountViewSet, CompanyAgencyViewSet, PrivateAmountViewSet, CompanyPersonAgencyViewSet, \
    CardAgencyPersonViewSet, ConsultCardViewSet, CompanyInfoAPIView, ContactListAPIView

router = DefaultRouter()
router.register(r'person', PersonInfoViewSet, basename="person")
router.register(r'company', CompanyInfoViewSet, basename="company")
router.register(r'private', PrivateContractViewSet, basename="private")
router.register(r'adviser', CompanyContractViewSet, basename="adviser")
router.register(r'amount', ContractAmountViewSet, basename="amount")
router.register(r'agency', CompanyAgencyViewSet, basename="agency")
router.register(r'agency_person', CompanyPersonAgencyViewSet, basename="agency-person")
router.register(r'pri_amount', PrivateAmountViewSet, basename="private_amount")
router.register(r'card_agency', CardAgencyPersonViewSet, basename="card-agency")
router.register(r'consult_card', ConsultCardViewSet, basename="consult-card")


urlpatterns = [
    path('companyinfo/', CompanyInfoAPIView.as_view(), name="api-company-info"),
    path('contact/', ContactListAPIView.as_view(), name="api-contact-list"),
]

urlpatterns += router.urls